import Vue from "vue";
import VueRouter from "vue-router";

import Users from "../views/users/index.vue";
import Add from "../views/userAdd";
import Update from "../views/users/Lists/update";
Vue.use(VueRouter);

const router = new VueRouter({
  mode: "history",
  routes: [
    {
      name: "users",
      path: "/users",
      component: Users,
    },
    {
      name: "code",
      path: "/user/add",
      component: Add,
    },
    {
      name: "update",
      path: "/user/update/:id",
      component: Update,
    },
    {
      path: "*",
      redirect: "/users",
    },
  ],
});

export default router;
